<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="./bootstrap-3.3.7-dist/css/bootstrap.min.css" rel=" stylesheet">
    <script src="./js/jquery-3.4.1.min.js"></script>
    <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <link href="./css/edit.css" rel=" stylesheet">
    <style th:include="include/navstyle :: styletwo"></style>
    <style th:include="include/footer :: style"></style>

</head>
<body>
<header>
    <nav th:include="include/navstyle :: nav"></nav>
</header>
<section style="text-align: center">
    <div class="codexml">
<textarea id="xmlcode" class="form-control" style="background-color: rgba(51,51,51,.2);"  rows="20" cols="20"></textarea>
    </div>
<form action="../editxml" method="post" enctype="multipart/form-data">
    <input type="submit" value="保存" class="btn" onclick="btnclock()" style="width: 20em;height: 4em;"/>
</form>
</section>
<footer th:include="include/footer :: footer"></footer>
<script>
    function btnclock() {
        var edit = document.getElementById('xmlcode').value;
        if (edit == null) {
            alert("你尚未修改该作品，无法保存！")
        } else {
            $.ajax({
                url: "http://localhost:8080/edit",
                type: "POST",
                dataType: "text",
                traditional: false,
                data: {
                    "edit": edit
                }
            });
        }
    }
</script>
</body>
</html>